package util

import "net/url"

func Image2Path(image string) string {
	if image == "" {
		return ""
	}
	u, err := url.Parse(image)
	if err != nil {
		return ""
	}
	u.Host = ""
	u.Scheme = ""
	return u.String()
}

func ImageArray2Path(array []string) []string {
	var res = make([]string, 0)
	if len(array) == 0 {
		return res
	}
	for _, s := range array {
		res = append(res, Image2Path(s))
	}
	return res
}
